<div class="wide form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'action'=>Yii::app()->createUrl($this->route),
	'method'=>'get',
)); ?>

	<div class="row">
		<?php echo $form->label($model,'number'); ?>
		<?php echo $form->textField($model,'number'); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'typeId'); ?>
		<?php echo $form->dropDownList($model,'typeId',AdvertisementType::model()->getAllTypes(),
			array('empty'=>'')); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'content'); ?>
		<?php echo $form->textField($model,'content',array('size'=>60,'maxlength'=>255)); ?>
	</div>
	
	<div class="row">
		<?php echo CHtml::label('Start Date', '');?>
		From
		<?php echo $form->hiddenField($model,'startDateAfter'); ?>
		<?php 
			$this->widget('zii.widgets.jui.CJuiDatePicker', array(
			    'name'=>'startDateAfterSelect',
			    'options'=>array(
					'altField'=>'#'.CHtml::activeId($model, "startDateAfter"),				
			    ),		   
			));
		?>
		To
		<?php echo $form->hiddenField($model,'startDateBefore'); ?>
		<?php 
			$this->widget('zii.widgets.jui.CJuiDatePicker', array(
			    'name'=>'startDateBeforeSelect',
			    'options'=>array(
					'altField'=>'#'.CHtml::activeId($model, "startDateBefore"),				
			    ),		   
			));
		?>
	</div>	

	<div class="row">
		<?php echo CHtml::label('End Date', '');?>
		From
		<?php echo $form->hiddenField($model,'endDateAfter'); ?>
		<?php 
			$this->widget('zii.widgets.jui.CJuiDatePicker', array(
			    'name'=>'endDateAfterSelect',
			    'options'=>array(
					'altField'=>'#'.CHtml::activeId($model, "endDateAfter"),				
			    ),		   
			));
		?>
		To
		<?php echo $form->hiddenField($model,'endDateBefore'); ?>
		<?php 
			$this->widget('zii.widgets.jui.CJuiDatePicker', array(
			    'name'=>'endDateBeforeSelect',
			    'options'=>array(
					'altField'=>'#'.CHtml::activeId($model, "endDateBefore"),				
			    ),		   
			));
		?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'client'); ?>
		<?php echo $form->textField($model,'client',array('size'=>60,'maxlength'=>255)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'paid'); ?>
		<?php echo $form->dropDownList($model,'paid',array(''=>'','1'=>'YES','0'=>'No')); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton('Search'); ?>
		<?php echo CHtml::resetButton('Reset',array(
			'onclick'=>'
				$("#AdvertisementSearch_startDateAfter").val("");
				$("#AdvertisementSearch_startDateBefore").val("");
				$("#AdvertisementSearch_endDateAfter").val("");
				$("#AdvertisementSearch_endDateBefore").val("");
			',
			'style'=>'width:55px',
		));?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- search-form -->